/**
 * 邮件服务API
 */
import axios from 'axios'
import { API_BASE_URL } from './config.js'

const BASE_URL = `${API_BASE_URL}/api/email`

/**
 * 获取邮件服务状态
 */
export const getEmailStatus = async () => {
  const response = await axios.get(`${BASE_URL}/status`)
  return response.data
}

/**
 * 发送邮件
 */
export const sendEmail = async (emailData) => {
  const response = await axios.post(`${BASE_URL}/send`, emailData)
  return response.data
}

/**
 * 发送交易通知
 */
export const sendTradeNotification = async (notificationData) => {
  const response = await axios.post(`${BASE_URL}/send-trade-notification`, notificationData)
  return response.data
}

/**
 * 测试邮件服务
 */
export const testEmail = async () => {
  const response = await axios.get(`${BASE_URL}/test`)
  return response.data
}
